package com.e1xp.deport_management_system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.e1xp.deport_management_system.entity.User;
import com.e1xp.deport_management_system.exception.CustomException;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author E1xP
 * @since 2021-04-09
 */
public interface IUserService extends IService<User> {

    User login(String username, String password, long timestamp) throws CustomException;

    User add(String username, String password, int type, long instanceId);

    void changePassword(long userId, String oldPassword, String newPassword) throws CustomException;

    boolean isInstance(long instanceId);

    void addInstance(User user) throws CustomException;

    List<User> getList(long instanceId);

    void suspendUser(long instanceId, long userId) throws CustomException;

    void activeUser(long instanceId, long userId) throws CustomException;

    User get(long instanceId, long id);

    void changeType(long instanceId, long id, int type) throws CustomException;

    void changePasswordFromAdmin(long instanceId, long id, String password) throws CustomException;
}
